/**
 * Created by liuhe on 2016/11/30.
 */
('use strict');

import * as mongoose from 'mongoose';

let platformInfoSchema = new mongoose.Schema({
  logo: String,
  storeRightNav: Boolean, //右侧导航展示与否
  SEO: {
    des: String, //SEO描述
    keywords: String //SEO关键字
  },
  thirdPartyCode: String, //第三方代码
  imageDefinitionRadio: Number //图片压缩比例
});

//申明 schema
let GlobalSetupSchema = new mongoose.Schema({
  uid: { type: String, required: true },
  systemCode: { type: String, required: true, enum: ['d2cStore', 'd2p', 'ehome','bm001'] },
  siteTitle: String,
  siteIconImgSrc: String,
  host: {},
  platformInfo: {
    pc: platformInfoSchema, //子文档会自动生成 _id
    weixin: platformInfoSchema,
    app: platformInfoSchema,
    pad: platformInfoSchema
  }
});

export default mongoose.model('GlobalSetup', GlobalSetupSchema);
